package blockworld;

import java.util.Comparator;






public class Result implements Comparable<Result> {

	
	private int _newState;
	private int _hpUsed;
	
	public Result (int newState, int hpUsed )
	{
		_newState = newState;
		_hpUsed = hpUsed;
	}
	
	
	@Override
	public int compareTo(Result o)
	{
		
		if( _newState < o.getNewState() )
			return -1;
		
		else if( _newState > o.getNewState() )
			return 1;
		
		else 
		{
			if( _hpUsed > o.getHpUsed() )
				return -1;
		
			if( _hpUsed < o.getHpUsed() )
				return 1;
		}
		return 0;
	}

	
	public int getNewState()
	{
		return _newState;
	}
	
	public int getHpUsed()
	{
		return _hpUsed;
	}
}
